package com.ld.security.shop.crawler.base.entity;

import com.ld.security.common.elastic.base.anno.EsKey;
import com.ld.security.common.elastic.base.constant.EsCondition;
import com.ld.security.common.elastic.base.model.SuperModel;
import com.ld.security.common.mybatis.anno.SqlKey;
import com.ld.security.common.mybatis.constant.SqlCondition;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

@Document(indexName = "sea_book", type = "sea_book")
@Data
public class SeaBook implements SuperModel {


    @Id
    @Field( type = FieldType.Keyword)
    @EsKey(EsCondition.eq)
    private String id;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")

    @EsKey(value = EsCondition.like,highlight = true)
    private String title;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    @EsKey(value = EsCondition.like,highlight = true)
    private String content;

    @Field(type = FieldType.Keyword)
    @EsKey(value = EsCondition.like_right)
    private String seaType;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    @EsKey(EsCondition.like)
    private String tags;

    @Field( type = FieldType.Keyword)
    private String picture;

    @Field(type = FieldType.Date)
    private Date crtTime;

    @Field(type = FieldType.Date)
    private Date uptTime;

    @SqlKey(SqlCondition.eq)
    @EsKey
    private String crtUser;
}
